package kr.hkit.info.powerjava.secondClass;

import java.io.Serializable;
//import java.util.Scanner;


public class Data2 implements Serializable {
	//@SuppressWarnings("serial")
/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
//private static final long serialVersionUID =1L;
String name;
String address;
String tel;
String email;

static int tel_count;
static int email_count;

//Scanner input = new Scanner(System.in);

public Data2() {
	super();
}

public Data2(String name) {
	this.name = name;
}

public Data2(String name, String address, String tel, String email) {
	this.name = name;
	this.address = address;
	this.tel = tel;
	this.email = email;
}

public String getName() {
	return name;
}

public void setName(String name) {
	this.name = name;
}

public String getAddress() {
	return address;
}

public void setAddress(String address) {
	this.address = address;
}

public String getTel() {
	return tel;
}

public void setTel(String tel) {
	this.tel = tel;
}

public String getEmail() {
	return email;
}

public void setEmail(String email) {
	this.email = email;
}

@Override
public String toString() {
	return "data [name=" + name + ", address=" + address + ", tel=" + tel
			+ ", email=" + email + "]";
}

@Override
public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((address == null) ? 0 : address.hashCode());
	result = prime * result + ((email == null) ? 0 : email.hashCode());
	result = prime * result + ((name == null) ? 0 : name.hashCode());
	result = prime * result + ((tel == null) ? 0 : tel.hashCode());
	return result;
}

@Override
public boolean equals(Object obj) {
	if (this == obj)
		return true;
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	Data2 other = (Data2) obj;
	if (address == null) {
		if (other.address != null)
			return false;
	} else if (!address.equals(other.address))
		return false;
	if (email == null) {
		if (other.email != null)
			return false;
	} else if (!email.equals(other.email))
		return false;
	if (name == null) {
		if (other.name != null)
			return false;
	} else if (!name.equals(other.name))
		return false;
	if (tel == null) {
		if (other.tel != null)
			return false;
	} else if (!tel.equals(other.tel))
		return false;
	return true;
}

}
